home *** CD-ROM | disk | FTP | other *** search
Wrap
property pCounter, pOldMouseLoc global gPaused, gTempActorList, cDotSpacing, cGridSize, cDmVctChnl, cSquareChnl, cGridChnl, cHiDotChnl, cGridHOffset, cGridVOffset, gErrCounter, gClicked, gTimer on beginSprite me pOldMouseLoc = the mouseLoc end on prepareFrame if (the mouseLoc <> pOldMouseLoc) and not gPaused then curH = the mouseH curV = the mouseV if (curH >= cGridHOffset) and (curH <= (cGridHOffset + (cGridSize * cDotSpacing))) and ((curV >= cGridVOffset) and (curV <= (cGridVOffset + (cGridSize * cDotSpacing)))) then spaceOffset = point(cGridHOffset - (cDotSpacing / 2), cGridVOffset - (cDotSpacing / 2)) dotOffset = 9 repeat with counter = 1 to 16 hLoc = spaceOffset[1] + (counter * cDotSpacing) if the mouseH < hLoc then curH = hLoc - dotOffset exit repeat end if if (counter = 16) and (the mouseH > hLoc) then curH = hLoc + cDotSpacing - dotOffset end if end repeat repeat with counter = 1 to 16 vLoc = spaceOffset[2] + (counter * cDotSpacing) if the mouseV < vLoc then curV = vLoc - dotOffset exit repeat end if if (counter = 16) and (the mouseV > vLoc) then curV = vLoc + cDotSpacing - dotOffset end if end repeat sprite(cSquareChnl).loc = point(curH, curV) else if not gClicked then if sprite(cSquareChnl).locH <> -500 then sprite(cSquareChnl).locH = -500 end if end if end if end if if (curH >= cGridHOffset) and (curH <= (cGridHOffset + (cGridSize * cDotSpacing))) and ((curV >= cGridVOffset) and (curV <= (cGridVOffset + (cGridSize * cDotSpacing)))) and gClicked then curH = sprite(cSquareChnl).locH curV = sprite(cSquareChnl).locV oldH = sprite(cHiDotChnl).locH oldV = sprite(cHiDotChnl).locV if (oldH <> curH) or (oldV <> curV) then vtxList = member("DmVct").vertexList prevLoc = getProp(vtxList[2], #vertex) newH = curH - oldH + 1 newV = curV - oldV + 1 if prevLoc <> point(newH, newV) then setProp(vtxList[2], #vertex, point(newH, newV)) member("DmVct").vertexList = vtxList end if else member("DmVct").vertexList = [[#vertex: point(1, 1)], [#vertex: point(1, 1)]] end if end if end on exitFrame if the timer > (gTimer + 100) then if sprite(cHiDotChnl).visible and sprite(cHiDotChnl + 1).visible then removeHiDots() end if if gErrCounter > 0 then removeHiDots() removeErrVcts() gTimer = the timer end if end if if not gPaused and (the actorList = []) then the actorList = duplicate(gTempActorList) gTempActorList = [] end if go(the frame) end